define countp
proc (L)
  if nullp(L) then
    return := 0;
  end;
  e := car(L);
  i := 0;
  if intp(e) then
    i := 1
  else
    i := countP(e);
  end
  return := i + countp(cdr(L));
end;
a := [1,[2,3,[4,[],5],6],7,8];
b := count(a)
